﻿using System;
using System.Collections.Specialized;

namespace ActivateYourGlutes.Data.Model
{
    public partial class Account
    {
        public NameValueCollection Validate()
        {
            var errors = new NameValueCollection();

            if (String.IsNullOrEmpty(Username))
                errors.Add("Username", "Username is required");
            if (DateOfBirth == DateTime.MinValue)
                errors.Add("DateOfBirth", "Date of birth is required");
            if (DateOfBirth >= DateTime.Now)
                errors.Add("DateOfBirth", "Date of birth must be in the past");

            return errors;
        }
    }
}
